import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';

export function createAutoImport() {
  return AutoImport({
    resolvers: [ElementPlusResolver()],
    imports: ['vue-router', 'vue', 'pinia'],
    dirs: ['src/hooks/**'],
    dts: 'src/auto-import.d.ts',
  });
}

export function createComponents() {
  return Components({
    resolvers: [ElementPlusResolver()],
    dts: 'src/components.d.ts',
  });
}
